package com.desiy.service.impl;

import com.desiy.dao.UserDao;
import com.desiy.entity.User;
import com.desiy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * @author Desiy
 * @date 2020/9/18 14:20
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    public Collection<User> queryList() {
        List<User> users = userDao.queryList();
        return users;
    }

    @Override
    public User queryById(int id) {
        User user = userDao.queryById(id);
        return user;
    }

    @Override
    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(int id) {
        userDao.delete(id);
    }
}
